package pers.books.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import pers.books.service.BuyTypeService;
import pers.books.util.ResultMessage;

@RestController
@RequestMapping("buytype")
public class BuyTypeController {

	@Autowired
	private BuyTypeService typeService;
	
	@RequestMapping(value="getall", method=RequestMethod.POST)
	public ResultMessage<?> getAllTypes(
			@RequestParam(value="nameLike", required=false, defaultValue="")String nameLike, int page, int rows) {
		return typeService.getAllTypes(nameLike, page, rows);
	}
	
}
